<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>華信商会(株) 販売管理業務システム</title>
    <LINK th:href="@{/css/financials.css}" rel="stylesheet" type="text/css">
    <META http-equiv="Content-Type" content="text/HTML; charset=shift_jis">
    <STYLE type="text/css">
        BODY {
            background-color: #F8F9FB;
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
        }

        .style13 {
            color: #FFFFFF;
            font-weight: bold;
        }
        .style28 {
            font-family: "ＭＳ ゴシック";
            font-size: 12px;
        }
        .detail-form {
            display: none;
            margin: 20px auto;
            padding: 15px;
            border: 1px solid #ccc;
            background-color: #f9f9f9;
            width: 80%;
            max-width: 800px;
            max-height: 300px;
            overflow-y: auto;
        }
        /* 非活性メニュー共通スタイル */
        .disabled {
            pointer-events: none;
            opacity: 0.5;
            cursor: not-allowed;
        }

        .disabled a {
            pointer-events: none;
        }
    </STYLE>
    <script language="javascript">
        function showDetailForm() {
            document.getElementById('orderDetailForm').style.display = 'block';
        }

        function hideDetailForm() {
            document.getElementById('orderDetailForm').style.display = 'none';
        }

        function goToPR30102() {
            showDetailForm();
            document.querySelector('input[name="submit"][value="発行"]').disabled = false;
        }

        function on_focus(){
            document.forms.nyuukoForm.shiiresaki_code.focus();
        }

    </script>
</head>
<body onLoad="on_focus()">
<!-- 页面头部和导航栏代码保持不变 -->


<TABLE width="100%" border="0" cellpadding="0" cellspacing="0">
    <!-- 省略?部、菜?等重??? -->
    <TABLE width="100%" border="0" cellpadding="0" cellspacing="0">
        <TR>
            <TD height="55" colspan="2">
                <TABLE width=100% height="56" border=0 cellPadding=0 cellSpacing=0>
                    <TBODY>
                    <TR bordercolor="0">
                        <TD height="49" bgColor=#666666>
                            <TABLE cellSpacing=0 cellPadding=0 width=100 border=0>
                                <TBODY>
                                <TR bordercolor="0">
                                    <TD><IMG src="/img/header_logo_rt.gif" width=1 border=0><IMG
                                            height=1 alt="Skip to page content"
                                            src="/img/sp.gif" width=1
                                            border=0></TD>
                                    <TD><IMG src="/img/header_logo.gif" width="185" height="49" border="0"></TD>
                                    <TD><IMG height=49 alt=""
                                             src="/img/header_logo_rt.gif"
                                             width=105 border=0></TD>
                                    <TD><IMG
                                            height=49 alt="" src="/img/header_title.gif"
                                            width=329 border=0></TD>
                                </TR>
                                </TBODY>
                            </TABLE>
                        </TD>
                        <TD align=right bgColor=#666666>&nbsp;

                        </TD>
                    </TR>
                    <TR align="right">
                        <TD colSpan=3 bgColor=#000000>
                            <IMG height=5 alt="" src="/img/sp.gif">
                            <script type="text/javascript" src="/js/time.js"
                                    language="JavaScript"></script>
                            <span id="clock"></span>
                        </TD>
                    </TR>
                    </TBODY>
                </TABLE>
            </TD>
        </TR>
        <TR>
            <TD width="152" height="100%" rowspan="2" valign="top"
                bgcolor="#FFFFFF">
                <TABLE width="152" height="501" border="0" cellpadding="0" cellspacing="0">
                    <TR>
                        <script type="text/javascript" src="/js/menu.js" language="JavaScript"></script>

                        <DIV class=main id=main5 onclick=expandIt(5)>
                            <TD width="152" height="285" valign="top" bgcolor="#FFFFFF"
                                STYLE="border-right: 1px solid rgb(204, 204, 204);">
                                <IMG height=11 alt="" src="/img/nav_divider.gif" width=150>
                                <DIV class=main id=main1 onClick=expandIt(1)
                                     th:classappend="${session.loginDeptName} != '営業課' ? ' disabled' : ''">
                                    <span class="titlefont">受注管理</span>
                                    <DIV class=sub id=sub1 STYLE="display:none"
                                         th:classappend="${session.loginDeptName} != '営業課' ? ' disabled' : ''">
                                        <A th:if="${session.loginDeptName} == '営業課'" href="@{'/PR10101'}">受注入力<BR>
                                        </A>
                                        <A th:unless="${session.loginDeptName} == '営業課'" class="disabled"
                                           href="javascript:void(0)">受注入力<BR> </A>
                                        <A th:if="${session.loginDeptName} == '営業課'" th:href="@{/PR10201}">商品別出庫表作成<BR>
                                        </A>
                                        <A th:unless="${session.loginDeptName} == '営業課'" class="disabled"
                                           href="javascript:void(0)">商品別出庫表作成<BR> </A>

                                        <span class="titlefont">月報作成<IMG
                                                src="/img/arrow_pagenext2.gif"> </span>
                                        <BR>
                                        <IMG src="/img/nav_arrow.gif">
                                        <A th:if="${session.loginDeptName} == '営業課'" href="PR10301.HTML">顧客別受注実績月報作成<BR>
                                        </A>
                                        <A th:unless="${session.loginDeptName} == '営業課'" class="disabled"
                                           href="javascript:void(0)">顧客別受注実績月報作成<BR> </A>
                                        <IMG src="/img/nav_arrow.gif">
                                        <A th:if="${session.loginDeptName} == '営業課'" th:href="@{/PR10401}">商品別受注実績月報作成<BR>
                                        </A>
                                        <A th:unless="${session.loginDeptName} == '営業課'" class="disabled"
                                           href="javascript:void(0)">商品別受注実績月報作成<BR> </A>
                                        <A th:if="${session.loginDeptName} == '営業課'"
                                           th:href="@{/PR10501}">在庫情報確認</A>
                                        <A th:unless="${session.loginDeptName} == '営業課'" class="disabled"
                                           href="javascript:void(0)">在庫情報確認</A>
                                    </DIV>
                                    <IMG height=11 alt="" src="/img/nav_divider.gif" width=150>
                                </DIV>
                                <DIV class=main id=main2 onClick=expandIt(2)
                                     th:classappend="${session.loginDeptName} != '経理課' ? ' disabled' : ''">
                                    <span class="titlefont">売掛管理</span>
                                    <DIV class=sub id=sub2 STYLE="display:none"
                                         th:classappend="${session.loginDeptName} != '経理課' ? ' disabled' : ''">
                                        <A th:if="${session.loginDeptName} == '経理課'" th:href="@{/PR20101}">売掛登録<BR>
                                        </A>
                                        <A th:unless="${session.loginDeptName} == '経理課'" class="disabled"
                                           href="javascript:void(0)">売掛登録<BR> </A>
                                        <A th:if="${session.loginDeptName} == '経理課'" th:href="@{/PR20201}">代金請求<BR>
                                        </A>
                                        <A th:unless="${session.loginDeptName} == '経理課'" class="disabled"
                                           href="javascript:void(0)">代金請求<BR> </A>
                                        <A th:if="${session.loginDeptName} == '経理課'" th:href="@{/PR20301}">入金登録</A>
                                        <A th:unless="${session.loginDeptName} == '経理課'" class="disabled"
                                           href="javascript:void(0)">入金登録</A>
                                    </DIV>
                                    <IMG height=11 alt="" src="/img/nav_divider.gif" width=150>
                                </DIV>
                                <DIV class=main id=main3 onClick=expandIt(3)
                                     th:classappend="${session.loginDeptName} != '倉庫課' ? ' disabled' : ''">
                                    <span class="titlefont">発注管理</span>
                                    <DIV class=sub id=sub3 STYLE="display:none"
                                         th:classappend="${session.loginDeptName} != '倉庫課' ? ' disabled' : ''">
                                        <A th:if="${session.loginDeptName} == '倉庫課'" th:href="@{/PR30101}">発注書作成<BR>
                                        </A>
                                        <A th:unless="${session.loginDeptName} == '倉庫課'" class="disabled"
                                           href="javascript:void(0)">発注書作成<BR> </A>
                                        <A th:if="${session.loginDeptName} == '倉庫課'" th:href="@{/PR30201}">検品入庫</A>
                                        <A th:unless="${session.loginDeptName} == '倉庫課'" class="disabled"
                                           href="javascript:void(0)">検品入庫</A>
                                    </DIV>
                                    <IMG height=11 alt="" src="/img/nav_divider.gif" width=150>
                                </DIV>
                                <DIV class=main id=main4 onClick=expandIt(4)
                                     th:classappend="${session.loginDeptName} != '経理課' ? ' disabled' : ''">
                                    <span class="titlefont">買掛管理</span>
                                    <DIV class=sub id=sub4 STYLE="display:none"
                                         th:classappend="${session.loginDeptName} != '経理課' ? ' disabled' : ''">
                                        <A th:if="${session.loginDeptName} == '経理課'" href="PR40101.HTML">買掛登録<BR>
                                        </A>
                                        <A th:unless="${session.loginDeptName} == '経理課'" class="disabled"
                                           href="javascript:void(0)">買掛登録<BR> </A>
                                        <A th:if="${session.loginDeptName} == '経理課'" href="PR40201.HTML">支払伝票作成</A>
                                        <A th:unless="${session.loginDeptName} == '経理課'" class="disabled"
                                           href="javascript:void(0)">支払伝票作成</A>
                                        <BR>
                                        <A th:if="${session.loginDeptName} == '経理課'" href="PR40301.HTML">支払額登録</A>
                                        <A th:unless="${session.loginDeptName} == '経理課'" class="disabled"
                                           href="javascript:void(0)">支払額登録</A>
                                    </DIV>
                                    <IMG height=11 alt="" src="/img/nav_divider.gif" width=150>
                                </DIV>
                                <DIV class=main id=main5 onClick=expandIt(5) th:classappend="' disabled'"><span
                                        class="titlefont">情報管理</span>
                                    <DIV class=sub id=sub5 style="display:none" th:classappend="' disabled'"><A
                                            href="PR50101.HTML">顧客情報管理<br>
                                    </A><a href="PR50201.HTML">商品情報管理</A><br>
                                        <A href="PR50301.HTML">仕入先情報管理</A><br>
                                        <A href="PR50401.HTML">担当者情報管理</A><br>
                                        <A href="/HTML/PR50501.HTML">部門情報管理</A>
                                    </DIV>

                    </TR>
                    <TR>
                        <TD height="48" valign="top" bordercolor="0">
                            <img src="/img/b.jpg" width="152" height="216" border="0" align="top">
                    </TR>
                </TABLE>
            </TD>


        <TR>
            <TD height="400" align="center" valign="top">
                <TABLE>
                    <TR>
                        <TD width="700">
                            <DIV class="header3"><BR></DIV>
                            <DIV class="bfont" align="left">ログイン：張毅</DIV>
                            <BR>
                            <DIV class="bfont" align="left">受注管理−＞在庫情報確認</DIV>
                        </TD>
                        <TD width="200">
                            <DIV class="bfont" align="right">
                                <span class="titlefont"><A th:href="@{/LOGON}">首頁</A></span>
                                <span class="titlefont">｜</span>
                                <span class="titlefont"><A th:href="@{/INDEX}">退出</A></span>
                            </DIV>
                        </TD>
                    </TR>
                </TABLE>





                <!-- 页面标题和路径代码保持不变 -->
                <HR>
                <form name="nyuukoForm" method="POST" th:action="@{/PR30101/issue}" th:object="${orderForm}">
                    <!-- 仕入先选择和日期选择表单代码保持不变 -->


                    <table align="center" width="200" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td><div align="center">
                                <table border="0" cellpadding="5" align="center">
                                    <tr align="left">
                                        <th nowrap class="datafont">仕入先コード</th>
                                        <td nowrap>
                                            <select th:field="*{shiiresakiCode} " name="shiiresaki_code" id="shiiresaki_code">
                                                <option value="">-- 仕入先を選択してください --</option>
                                                <option th:each="supplier : ${supplierList}"
                                                        th:value="${supplier.M00401}"
                                                        th:text="${supplier.M00401 + ' ' + supplier.M00403}">
                                                </option>
                                            </select>
                                            &nbsp;&nbsp;&nbsp;
                                            <input type="button" name="submit" value="検索" onClick="goToPR30102()">
                                        </td>
                                    </tr>
                                    <tr align="left">
                                        <th nowrap class="datafont">希望発注納期</th>
                                        <td nowrap>
                                            <select th:field="*{nengouCode}" name="nengou_code">
                                                <option value="1">平成</option>
                                                <option value="1">令和</option>
                                            </select>
                                            <select th:field="*{kotosi}" name="kotosi">
                                                <option value="25">25</option>
                                                <option value="24">24</option>
                                                <option value="23">23</option>
                                                <option value="22">22</option>
                                                <option value="21">21</option>
                                                <option value="20">20</option>
                                                <option value="19">19</option>
                                                <option value="18">18</option>
                                                <option value="17">17</option>
                                                <option value="16">16</option>
                                            </select>&nbsp;年
                                            <select th:field="*{gathu}" name="gathu">
                                                <option value="1">1</option>
                                                <option value="2">2</option>
                                                <option value="3">3</option>
                                                <option value="4">4</option>
                                                <option value="5">5</option>
                                                <option value="6">6</option>
                                                <option value="7">7</option>
                                                <option value="8">8</option>
                                                <option value="9">9</option>
                                                <option value="10">10</option>
                                                <option value="11">11</option>
                                                <option value="12">12</option>
                                            </select>&nbsp;月
                                            <select th:field="*{niti}" name="niti">
                                                <option value="1">1</option>
                                                <option value="2">2</option>
                                                <option value="3">3</option>
                                                <option value="4">4</option>
                                                <option value="5">5</option>
                                                <option value="6">6</option>
                                                <option value="7">7</option>
                                                <option value="8">8</option>
                                                <option value="9">9</option>
                                                <option value="10">10</option>
                                                <option value="11">11</option>
                                                <option value="12">12</option>
                                                <option value="13">13</option>
                                                <option value="14">14</option>
                                                <option value="15">15</option>
                                                <option value="16">16</option>
                                                <option value="17">17</option>
                                                <option value="18">18</option>
                                                <option value="19">19</option>
                                                <option value="20">20</option>
                                                <option value="21">21</option>
                                                <option value="22">22</option>
                                                <option value="23">23</option>
                                                <option value="24">24</option>
                                                <option value="25">25</option>
                                                <option value="26">26</option>
                                                <option value="27">27</option>
                                                <option value="28">28</option>
                                                <option value="29">29</option>
                                                <option value="30">30</option>
                                                <option value="31">31</option>
                                            </select>&nbsp;日
                                            <span class="datafont">（省略時翌日）</span>
                                        </td>
                                    </tr>
                                </table>
                            </div></td>
                        </tr>
                    </table>




                    <table width="250" border="0" cellpadding="5">
                        <tr align="center">
                            <td><input type="button" name="clear" value="クリア" th:onclick="|window.open('@{/PR30201}','_self')|"></td>

                            <td><input type="submit" name="submit" value="発行" disabled></td>
                        </tr>
                    </table>

                    <!-- 発注商品明細表单 -->
                    <div class="detail-form" id="orderDetailForm">
                        <table BORDER="0">
                            <caption><B>発注商品明細</B></caption>
                            <tbody bgcolor=lightcyan id="productTableBody">
                            <tr bgcolor=darkkhaki>
                                <th>項番</th>
                                <th>商品コード</th>
                                <th>商品名</th>
                                <th>単位</th>
                                <th>仕入単価</th>
                                <th>仕入数量</th>
                                <th>選択</th>
                            </tr>
                            <!-- 动态数据行：修复分组分隔符格式 -->
                            <tr th:each="product, stat : ${productList}">
                                <td NOWRAP ALIGN="CENTER" width="30" th:text="${stat.index + 1}">1</td>
                                <td NOWRAP ALIGN="CENTER" width="80" th:text="${product.M00201}"></td>
                                <td NOWRAP ALIGN="LEFT" width="250" th:text="${product.M00202}"></td>
                                <td NOWRAP ALIGN="CENTER" width="60" th:text="${product.M00204}"></td>
                                <!-- 核心修复：使用Thymeleaf支持的'COMMA'风格（千位逗号分隔） -->
                                <td NOWRAP ALIGN="RIGHT" width="60" th:text="${#numbers.formatDecimal(product.M00205, 1, 0, 'COMMA')}">1,500</td>
                                <td NOWRAP ALIGN="RIGHT" width="60" th:text="${product.M00209}">50</td>
                                <td NOWRAP ALIGN="CENTER" width="40">
                                    <input type="checkbox" th:field="*{selectedProductCodes}" th:value="${product.M00201}">
                                </td>
                            </tr>
                            <tr th:if="${#lists.isEmpty(productList)}">
                                <td colspan="7" align="center">商品データが存在しません</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <!--            <input name="supplierCode" type="hidden" th:value="${supplierCode}">-->
                    <!--            <input name="supplierName" type="hidden" th:value="${supplierName}">-->
                </form>
            </TD>
        </TR>
        <!-- 页面底部代码保持不变 -->

        <TR>
            <TD align="center" valign="bottom">
                <TABLE width="100%" border="0" align="right" cellpadding="0" cellspacing="0">
                    <TR>
                        <TD align="right" bgcolor="#F8F9FB"><DIV align="left"><IMG th:src="@{/img/eds.jpg}" width="404" height="60"></DIV></TD>
                        <TD align="right" bgcolor="#F8F9FB"><IMG th:src="@{/img/struts-power.gif}" width="95" height="37"></TD>
                    </TR>
                </TABLE>
            </TD>
        </TR>
        <TR>
            <TD height="10" colspan="2">
                <TABLE width=100% border=0 cellpadding=0 cellspacing=0 bgcolor="#666666">
                    <tbody>
                    <TR>
                        <TD width="756" bgcolor="#000000"><span class="style13"><span class="style28">c2008 大連華信計算機新技術培訓中心. すべての知る権利を保留</span></span> </TD>
                    </TR>
                    </tbody>
                </TABLE>
            </TD>
        </TR>

    </TABLE>
</body>
</html>